package cn.sixmillions.yuqueblog.common.constant;

/**
 * @description: 语雀常量类
 * @author: sixmillions
 * @since: 2021/12/10
 **/
public class YuQueConstant {

    /**
     *
     */
    public static final String AUTH_HEADER = "X-Auth-Token";

    /**
     * 缓存namespace
     */
    public static final String CACHE_NAMESPACE = "YUQUE::";

    /**
     * 用户信息缓存key'
     */
    public static final String USER_CACHE_KEY = CACHE_NAMESPACE + "USER::%s";

    /**
     * 所有 API 的路径开头
     */
    public static final String BASE_URL = "https://www.yuque.com/api/v2";

    /**
     * 用户信息请求接口
     */
    public static final String USER_URL = BASE_URL + "/users/%s";

    /**
     * 知识库列表缓存key
     */
    public static final String REPOS_CACHE_KEY = CACHE_NAMESPACE + "REPOS::%s";

    /**
     * 知识库请求接口
     */
    public static final String REPO_URL = BASE_URL + "/users/%s/repos";

    /**
     * 知识库目录key
     */
    public static final String REPO_TOC_CACHE_KEY = CACHE_NAMESPACE + "TOC::%s";

    /**
     * 知识库目录请求接口
     */
    public static final String REPO_TOC_URL = BASE_URL + "/repos/%s/toc";

    /**
     * 知识库文档列表key
     */
    public static final String REPO_DOCS_CACHE_KEY = CACHE_NAMESPACE + "DOCS::%s";

    /**
     * 知识库文档列表请求接口
     */
    public static final String REPO_DOCS_URL = BASE_URL + "/repos/%s/docs";

    /**
     * 文档详细内容key
     */
    public static final String DOC_CACHE_KEY = CACHE_NAMESPACE + "DOC::%s:%s";

    /**
     * 文档详细内容请求接口
     */
    public static final String DOC_URL = BASE_URL + "/repos/%s/docs/%s";
}
